﻿
using hcache;
using hdal;
using hentity;
using hq;
using System;
using System.Collections.Generic;
 namespace htaskCommon {
    public abstract class AbsWcs2WmsTask :ZtTask {
 
          protected IWCSServer wcsServer = WMSDalFactray.getDal<IWCSServer>();
         public override void excute() {
            List<CoreTaskParam> list = CompleteParamCache.getWokingCompleteParam();
            foreach( CoreTaskParam param in list ) {
                 bool res = false;
                 if( param.status == ( int ) CoreTaskParamStatus.满放变更 ) {
                    res= putFull(param);
                } else if( param.status == ( int ) CoreTaskParamStatus.空取 ) {
                    res= getEmply(param);
                } else if( isFinsh( param) ) {
                    if( commit(param) ) {
                        CacheFacade.removeComplete(param.taskId);
                    }
            
                }
               
            }
         }
        public virtual bool isFinsh(CoreTaskParam param) {
            if( param.status == ( int ) CoreTaskParamStatus.执行结束 ) {
                return param.cDes == param.des  || param.cStn == param.des;
            }
            return false;
        }
          public abstract bool putFull(CoreTaskParam param);
        public abstract bool getEmply(CoreTaskParam param);
       
         public abstract bool commit(CoreTaskParam param);
     }
}
